Ticket #3159: Update color names#5001
Open
egmontkob wants to merge 3 commits intoMidnightCommander:masterfrom
Open
Ticket #3159: Update color names#5001egmontkob wants to merge 3 commits intoMidnightCommander:masterfrom
egmontkob wants to merge 3 commits intoMidnightCommander:masterfrom
Conversation
Don't pass color names like "black", "red" to slang, instead pass index-based identifiers like "color0", "color1" etc. This is in preparation for the next commit in which mc will diverge from slang's color names. Signed-off-by: Egmont Koblinger <egmont@gmail.com>
zyv
approved these changes
Feb 6, 2026
Member
zyv
left a comment
There was a problem hiding this comment.
I simply scrolled through the changes trying to see if anything stands out that shouldn't have been replaced, but nothing jumped out.
2 tasks
For the legacy 16 colors, switch to a more standard naming that better reflects their internal 8+8 logic. Old names marked with a '-', new names marked with a '+' here: black -gray -> black +brightblack red brightred -> red brightred green brightgreen -> green brightgreen -brown -yellow -> +yellow +brightyellow blue brightblue -> blue brightblue magenta brightmagenta -> magenta brightmagenta cyan brightcyan -> cyan brightcyan -lightgray -white -> +white +brightwhite This is a backwards incompatible change. Skin and syntax highlight files need to be updated. Signed-off-by: Egmont Koblinger <egmont@gmail.com>
We are breaking skin compatibility anyway, so there's no point carrying it. Signed-off-by: Egmont Koblinger <egmont@gmail.com>
61a75b6 to
5bf3d6a
Compare
Contributor
Author
|
I forgot the obvious last step: a recursive search for the old names. I forgot to update one file, addressed now. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed changes
Change the color names as proposed in #3159 (comment).
Checklist
git commit --amend -smake indent && make check)While working on this change, I noticed that mc used the same color names as slang (it does take strings like "brown", "yellow" etc. in its API). I assume that's where mc's terminology originated from, it just simply decided to pass the strings unchanged to slang and document them.
Luckily, slang has also accepted since the ancient days (199x) keywords like "color0", "color1" etc. instead. So I'm switching to using them, rather than having two confusingly slightly different namings, like mapping mc's "brightyellow" to slang's "yellow" and such.
Most of the big change was prepared using this trivial script
but then I did a thorough review and had to revert here and there; most notably in css.syntax so that we don't change the color-related css keywords.
Although I've prepared this change now and I'd appreciate a review, I think I'll hold it back until we come up with more backwards incompatible changes, like the revamp of the skin file's keywords. I don't want this one to be the first (and if for whatever reason the work stop then the only) backwards incompatible skin change.